package core;

/**
 * A thread that repaints a given object. Since repaint() runs asynchronously this could be completely useless.
 */
import java.awt.Component;
import java.awt.Container;

public class PaintThread extends Thread{
	Component c;
	
	public PaintThread(Component i){
		c=i;
	}
	
	public void run(){
		c.repaint();
		Container co = c.getParent();
		int x=c.getX();
		int y=c.getY();
		int width = c.getWidth();
		int height = c.getHeight();
		if (co != null){
			co.repaint(x, y, width, height);
		}
	}
}
